import Vue from 'vue';
import Vuex from 'vuex';
import persistedState from 'vuex-persistedstate'

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    login: false,
    commentListKey: 0,
    id:null,
    firstVisit:true,
    avatar:'',
  },
  mutations: {
    setLogin(state, login) {
      state.login = login;
    },
    setCommentListKey(state, key){
      state.commentListKey = key
    },
    setId(state, id) {
      state.id = id;
    },
    setFirstVisit(state, firstVisit) {
      state.firstVisit = firstVisit;
    },
    setAvatar(state, avatar) {
      state.avatar = avatar;
    },
  },
  actions: {
  },
  modules: {
  },
  plugins: [persistedState()]
});
